import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/home/Home'
const Home =()=>import('../views/home/Home')
import Movie from '../views/home/movie/Movie'
import Video from '../views/home/video/Video'
import ShortVideo from '../views/home/shortvideo/ShortVideo'
import Show from '../views/home/show/Show'
import My from '../views/home/my/My'
import City from '../views/city/City'
import HotShowing from '../views/home/movie/HotShowing'
import Comingsoon from '../views/home/movie/Comingsoon'
import Theater from '../views/home/movie/Theater'
import Classic from '../views/home/movie/Classic'
import Detail from '../views/detail/Detail'

Vue.use(VueRouter)

  const routes = [
    {
      path:'/',
      redirect:'/home/movie/hotshowing'
    },
    {
      path:'/city',
      component:City
    },
    {
      path:'/home',
      component:Home,
      children:[
        {
          path:'/home/movie',
          component:Movie,
          redirect:'/home/movie/hotshowing',
          children:[
            {
              // 相对路径
              path:'hotshowing',
              component:HotShowing
            },
            {
              path:'/home/movie/theater',
              component:Theater
            },
            {
              path:'/home/movie/comingsoon',
              component:Comingsoon
            },
            {
              path:'/home/movie/classic',
              component:Classic
            }
          ]
        },
        {
          path:'/home/video',
          component:Video
        },
        {
          path:'/home/shortvideo',
          component:ShortVideo
        },
        {
          path:'/home/show',
          component:Show
        },
        {
          path:'/home/my',
          component:My
        }
      ]
    },
    {
      path:"/detail",
      name:"detail",
      component:Detail
    }
  ]

const router = new VueRouter({
  routes
})

export default router
